<?php
class MD_Contact extends Zend_Db_Table_Abstract
{
   protected $_name = "comment";	
	
   public function __construct( array $config)
   {
   	 parent::__construct(array('table' =>$this->_name));
   }
   
   public function getAll()
   {
   	$contact = $this->select()->order('date DESC');
   	var_dump($contact);
   	exit;
   	return $this->select()->order('date DESC');
   }
    
    public  function getContactById($id)
    {
    	$contact = TN_Db::getInstance()->fetchAll("SELECT * FROM comment where id = $id");
    	return $contact[0];
    }
    
    public  function insert($name, $lastName, $email, $comment)
    {
    	TN_Db::getInstance()->insert('comment', array('name'=> $name, 'last_name' => $lastName,'email' => $email , 'comment' => $comment, 'date' =>  date("Y-m-d")));
    }
}